package music.utils.zipcode;

import music.dao.ZipcodeDAO;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by pc01 on 11/6/2014.
 */
@WebServlet("/Zipcode.do")
public class ZipcodeServletUtil extends HttpServlet {
    protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        res.setContentType("text/html; charset=UTF-8");

        String dong = req.getParameter("mydong");

        PrintWriter out = res.getWriter();


        //System.out.println("ㅋㅋㅋ");
        System.out.println(ZipcodeDAO.selectZipcode(dong));

        out.print(ZipcodeDAO.selectZipcode(dong));
        out.flush();
        out.close();


    }
}
